package cn.heyige.backend.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

@Data
@Schema(description = "次数包相关数据传输对象")
public class QuotaPackageDto {

    @Setter
    @Getter
    @Schema(description = "创建订单请求")
    public static class CreateOrderRequest {
        @Schema(description = "次数包ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED)
        @NotNull(message = "次数包ID不能为空")
        private Integer quotaPackageId;
    }

    @Setter
    @Getter
    @Schema(description = "支付请求")
    public static class PayRequest {
        @Schema(description = "支付方式", example = "alipay", requiredMode = Schema.RequiredMode.REQUIRED)
        @NotNull(message = "支付方式不能为空")
        private String paymentMethod;

        @Schema(description = "支付单号", example = "2024010112345678")
        private String paymentNo;
    }

    @Setter
    @Getter
    @Schema(description = "订单响应")
    public static class OrderResponse {
        @Schema(description = "订单ID", example = "1")
        private Integer id;

        @Schema(description = "用户ID", example = "1")
        private Integer userId;

        @Schema(description = "订单号", example = "ORDER2024010112345678")
        private String orderNo;

        @Schema(description = "订单状态", example = "PAID")
        private String status;

        @Schema(description = "订单金额", example = "99.99")
        private Double amount;

        @Schema(description = "次数数量", example = "100")
        private Integer quota;

        @Schema(description = "次数包ID", example = "1")
        private Integer quotaPackageId;

        @Schema(description = "次数包名称", example = "基础次数包")
        private String quotaPackageName;

        @Schema(description = "次数包描述", example = "包含100次AI对话")
        private String quotaPackageDescription;

        @Schema(description = "原价", example = "199.99")
        private Double originalPrice;

        @Schema(description = "实际价格", example = "99.99")
        private Double actualPrice;

        @Schema(description = "支付时间", example = "2024-01-01T12:00:00")
        private LocalDateTime paidTime;

        @Schema(description = "创建时间", example = "2024-01-01T10:00:00")
        private LocalDateTime createdAt;
    }
}